<template>
  <div>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisibleImport"
      width="30%"
      :close-on-click-modal="false"
    >
      <div>
        <!-- :data="uploadData" -->
        <el-upload
          class="upload-demo"
          drag
          name="csv_file"
          action="https://app.server.jkcae.com/app/expressAppOrder"
          :multiple="false"
          :limit="1"
          :on-success="onSuccessFront"
        >
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">上传文件</div>
        </el-upload>
      </div>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="cancelDialogUpload">取 消</el-button>
        <el-button type="primary" @click="sureDialogUpload">确 定</el-button>
      </span> -->
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogVisibleImport: false,
    };
  },
  methods: {
    // 上传身份证正面成功
    onSuccessFront(response) {
      if (response.code == 1) {
        this.$message.success("上传成功");
        this.$emit("successBatch", response.data);
      } else {
        this.$message.error("上传失败");
        return;
      }
    },
  },
};
</script>
<style lang="scss" scoped></style>
